home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8276 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Alternatives to cin?
  5. Date: 16 Feb 1996 11:41:33 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4g1qhd$mhf@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe4.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Feb 13, 1996 21:50:23 in article <Alternatives to cin?>,
  15. 'michael_@sfsu.edu (Michael J. Legac)' wrote: 
  16.  
  17.  
  18. >    I've been programming in C/C++ for about a year and a half now;  
  19. >primarily for my school classes, but I've yet to find an alternative to  
  20. >the kludgy cin/scanf. I mainly code with gcc/g++, on my school's Solaris
  21. 5.3  
  22. >system and at home on Linux.  
  23. >    Basically, I just want to get rid of the <CR> cin requires. I  
  24. >guess what I'm looking for is either some way to do key bindings. I've  
  25. >done this before in Pascal and ASM on the PC, using interupts, but I'm  
  26. >sure there is a more portable way. Any code I write, I'd like to compile  
  27. >and run on either UNIX/Linux/x86.  
  28. >    Comments/suggestions are appreciated. 
  29. There's no portable way to do that in the language.  Reading the 
  30. keyboard directly is platform-dependent.  The easiest thing to do, 
  31. if you want portability, is to create a small library yourself in a 
  32. version for each platform.  On Unix, you can use the curses 
  33. library.  On PC's, use the conio stuff or assembler. 
  34.  
  35. -- 
  36. Pete Grant 
  37. Kalevi, Inc. 
  38. Software Engineering & development
  39.